package com.hjc.project.util.disruptor;

import com.google.common.base.Charsets;
import com.google.common.io.Files;
import com.lmax.disruptor.EventHandler;

import java.io.File;
import java.util.ArrayList;

public class QueryEventHandler implements EventHandler {
    @Override
    public void onEvent(Object o, long l, boolean b) throws Exception {
        File sinkFile = new File("D:/test1");
        if (sinkFile.length() > 1000000) {
            return;
        }
        Files.asCharSink(sinkFile, Charsets.UTF_8).writeLines(new ArrayList<>());
    }
}
